;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;; Copyright © 2022 (unmatched parenthesis <paren@disroot.org>
;;;
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guixrus packages grex)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (gnu packages)
  #:use-module (gnu packages check)
  #:use-module (gnu packages crates-io)
  #:use-module (gnu packages crates-graphics)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages tls)
  #:use-module ((guixrus packages common rust) #:prefix rus:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix utils)
  #:use-module (guix build-system cargo))

(define-public grex
  (package
    (name "grex")
    (version "1.3.0")
    (source
      (origin
        (method url-fetch)
        (uri (crate-uri "grex" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32 "0vyq6qmlhssvb8rj1fdvkn9ssv5j5lp70lx5j8h6rqdcd5cvc5in"))))
    (build-system cargo-build-system)
    (arguments
      `(#:cargo-inputs
        (("rust-atty" ,rust-atty-0.2)
         ("rust-itertools" ,rust-itertools-0.10)
         ("rust-lazy-static" ,rust-lazy-static-1)
         ("rust-ndarray" ,rust-ndarray-0.15)
         ("rust-petgraph" ,rust-petgraph-0.6)
         ("rust-regex" ,rust-regex-1)
         ("rust-structopt" ,rus:rust-structopt-0.3.23)
         ("rust-unic-char-range" ,rust-unic-char-range-0.9)
         ("rust-unic-ucd-category" ,rus:rust-unic-ucd-category-0.9)
         ("rust-unicode-segmentation" ,rust-unicode-segmentation-1))
        #:cargo-development-inputs
        (("rust-assert-cmd" ,rust-assert-cmd-2)
         ("rust-indoc" ,rust-indoc-1)
         ("rust-predicates" ,rust-predicates-2)
         ("rust-proptest" ,rust-proptest-1)
         ("rust-rstest" ,rus:rust-rstest-0.11)
         ("rust-tempfile" ,rust-tempfile-3))))
    (home-page "https://github.com/pemistahl/grex")
    (synopsis "Generate regular expressions from user-provided test cases")
    (description
"@code{grex} generates regular expressions from user-provided test cases.")
    (license license:asl2.0)))
